<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Danh sách chương trình đã phát</h1>
    </div>
    <!-- /.col-lg-12 -->

    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                Danh sách câu hỏi
            </div>
            <!-- /.panel-heading -->
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                        <thead>
                            <tr>
                                <th>STT</th>
                                <th>Chương trình</th>
                                <th>Ngày phát sóng</th>
                                <th style="text-align: center">Kênh phát sóng</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                            <?php $i = 0; foreach($data AS $key=>$value): $i=$i+1;?>
                                <tr data-id="<?php echo $value->id?>">
                                    <td><?php echo $i?></td>
                                    <td><?php echo $value->tvshow_name?></td>
                                    <td><?php $date = new DateTime(); $date->setTimestamp($value->time_start); echo $date->format('d/m/Y')?></td>
                                    <td><?php echo $value->channel?></td>
                                </tr>
                            <?php endforeach;?>
                        </tbody>
                    </table>
                </div>
                <!-- /.table-responsive -->
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /table -->
    </div>
    <!-- /.col-lg-12 -->
</div>

<script>
    $(document).ready(function(){
        $('tr').on('click', function(){
            var id = $(this).data('id');
            window.location.assign(baseUrl+'manage/control/question-history?id='+id);
        });
    });
</script>